import java.util.Date;
import java.util.LinkedList;

public class Project {
	
	private String name;
	private String description;
	private Date startDate;
	
	private LinkedList<Version> versionList;
	
	public Project()
	{
		name = "";
		description = "";
		startDate = new Date();
		versionList = new LinkedList<Version>();
	}
	
	public Project(String name)
	{
		this.name = name;
		
		startDate = new Date(); // Use current date for default
		description = "";
		versionList = new LinkedList<Version>();		
	}
	
	/**
	 * A Project must contain a valid project name, description and start date.
	 * @param name - the name of the project.
	 * @param description - a short description of the project.
	 * @param startDate - the start date of the project.
	 */
	public Project(String name, String description, Date startDate)
	{
		this.name = name;
		this.description = description;
		this.startDate = startDate;
		
		versionList = new LinkedList<Version>();
	}

	/**
	 * @return Returns the description.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description The description to set.
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name The name to set.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return Returns the startDate.
	 */
	public Date getStartDate() {
		return startDate;
	}

	/**
	 * @param startDate The startDate to set.
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	/**
	 * @return Returns the versionList.
	 */
	public LinkedList<Version> getVersionList() {
		return versionList;
	}

	/**
	 * @param versionList The versionList to set.
	 */
	public void setVersionList(LinkedList<Version> versionList) {
		this.versionList = versionList;
	}
	
	/**
	 * Adds a version to the project.
	 * @param version - the version to add.
	 */
	public void addVersion(Version version)
	{
		versionList.add(version);
	}
	
	/**
	 * Remove a version from the project.
	 * @param version - the version to remove.
	 * @returns boolean - whether or not the version could be removed.
	 */
	public boolean removeVersion(Version version)
	{
		return versionList.remove(version);
	}
	
	public int generateReleaseSequenceNum()
	{
		return (versionList.size() + 1);
	}

}

